package zfl.fanglong.cn.service;

import org.springframework.jms.core.JmsTemplate;

import zfl.fanglong.cn.domain.MyMessage;

public class JMSSenderAndReciever {
  private JmsTemplate jmsTemplate;
  public void send(MyMessage mm){
	  jmsTemplate.convertAndSend(mm);
  }
  public void sendConsole(MyMessage mm){
	  jmsTemplate.convertAndSend("zfl.fanglong.cn.queue2", mm);
  }
  public MyMessage recieve(){
	  return (MyMessage) jmsTemplate.receiveAndConvert();
  }
public JmsTemplate getJmsTemplate() {
	return jmsTemplate;
}
public void setJmsTemplate(JmsTemplate jmsTemplate) {
	this.jmsTemplate = jmsTemplate;
}
  
}
